<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('销售订单单头列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>用户id
：</label>
                                <input type="text" name="userId"/>
                            </li>
                            <li>
                                <label>订单单号：</label>
                                <input type="text" name="orderNo"/>
                            </li>
                            <li>
                                <label>订单金额(总金额)：</label>
                                <input type="text" name="buyPrice"/>
                            </li>
                            <li>
                                <label>优惠总金额，单位：分：</label>
                                <input type="text" name="discountPrice"/>
                            </li>
                            <li>
                                <label>物流金额：</label>
                                <input type="text" name="logisticsPrice"/>
                            </li>
                            <li>
                                <label>最终金额，单位：分：</label>
                                <input type="text" name="presentPrice"/>
                            </li>
                            <li>
                                <label>金额(分)：</label>
                                <input type="text" name="payAmount"/>
                            </li>
                            <li>
                                <label>付款时间：</label>
                                <input type="text" class="time-input" placeholder="请选择付款时间" name="paymentTime"/>
                            </li>
                            <li>
                                <label>发货时间：</label>
                                <input type="text" class="time-input" placeholder="请选择发货时间" name="deliveryTime"/>
                            </li>
                            <li>
                                <label>收货时间：</label>
                                <input type="text" class="time-input" placeholder="请选择收货时间" name="receiverTime"/>
                            </li>
                            <li>
                                <label>成交时间：</label>
                                <input type="text" class="time-input" placeholder="请选择成交时间" name="closingTime"/>
                            </li>
                            <li>
                                <label>是否退换货：</label>
                                <input type="text" name="hasReturnExchange"/>
                            </li>
                            <li>
                                <label>状态</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>删除状态：</label>
                                <input type="text" name="deleted"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:order:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:order:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:order:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:order:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:order:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
        var prefix = ctx + "system/order";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "销售订单单头",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'Id，自增长',
                    visible: false
                },
                {
                    field: 'userId',
                    title: '用户id'
                },
                {
                    field: 'orderNo',
                    title: '订单单号'
                },
                {
                    field: 'buyPrice',
                    title: '订单金额(总金额)'
                },
                {
                    field: 'discountPrice',
                    title: '优惠总金额，单位：分'
                },
                {
                    field: 'logisticsPrice',
                    title: '物流金额'
                },
                {
                    field: 'presentPrice',
                    title: '最终金额，单位：分'
                },
                {
                    field: 'payAmount',
                    title: '金额(分)'
                },
                {
                    field: 'paymentTime',
                    title: '付款时间'
                },
                {
                    field: 'deliveryTime',
                    title: '发货时间'
                },
                {
                    field: 'receiverTime',
                    title: '收货时间'
                },
                {
                    field: 'closingTime',
                    title: '成交时间'
                },
                {
                    field: 'hasReturnExchange',
                    title: '是否退换货'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    field: 'deleted',
                    title: '删除状态'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>